<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../animate.css">
    <style>
        .app {
            width: 430px;
            margin: 10px auto;
        }
        
        .nav {
            width: 430px;
            height: 50px;
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        
        .nav1 {
            width: 100px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            box-sizing: border-box;
            background-color: pink;
            cursor: pointer;
            border-radius: 10px;
        }
        
        .nav .active {
            background-color: deeppink;
            box-shadow: 0px 0px 10px #333;
            /* position: absolute; */
        }
        
        .cont {
            width: 430px;
            height: 430px;
            line-height: 440px;
            text-align: center;
            position: relative;
            transform-style: preserve-3d;
        }
        
        .cont1 {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            /* display: none; */
            box-sizing: border-box;
            background-color: burlywood;
            box-shadow: 0px 0px 10px #333;
            border-radius: 20px;
        }
        
        .shake {
            animation: shake 1s;
        }
    </style>
</head>

<body>
    <div class="app">
        <div class="nav ">
            <div class="nav1 " v-for="(item,index) in arr" @click="changestaic(index)" :class="staic==index?'active shake':''" :key="index">{{item}}</div>
        </div>
        <div class="cont">
            <div class="cont1" v-for="(item,index) in arrcont" :key="index" v-show="staic==index">{{item}}</div>
        </div>
    </div>
    <script src="../vue.js"></script>
    <script>
        const vm = new Vue({
            data: {
                staic: 0,
                arr: ["安踏", "耐克", "李宁", "匹克"],
                arrcont: ["外套", "裤子", "鞋子", "拖鞋"],
            },
            methods: {
                changestaic(index) {
                    this.staic = index
                }
            }
        }).$mount(".app")
    </script>
</body>

</html>